import request from '@/utils/request'

export function login(username, password, vrifyCode) {
  return request({
    url: '/login',
    method: 'post',
    data: {
      username,
      password,
      vrifyCode
    }
    // transformRequest: (data) => {
    //   const fd = new FormData()
    //   for (const i in data) {
    //     fd.append(i, data[i])
    //   }
    //   return fd
    // }
  })
}

export function getInfo(id) {
  return request({
    url: '/sec/userDetail', // '/sec/user',
    method: 'get'
  })
}

export function logout() {
  return request({
    url: '/logout',
    method: 'get'
  })
}
